package com.fubowen.reader.adapter

import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.fubowen.reader.ui.download.FileExplorerFragment
import com.fubowen.reader.ui.download.ScanExplorerFragment
import com.fubowen.reader.ui.download.ScanWebFragment

val tabLayout = mutableListOf(
    "本地" to ScanExplorerFragment(),
    "目录" to FileExplorerFragment(),
    "网址" to ScanWebFragment(),
)

class ImportBookViewPagerAdapter(fragmentManager: FragmentManager) : FragmentPagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
    override fun getCount() = tabLayout.size
    override fun getItem(position: Int) = tabLayout[position].second
    override fun getPageTitle(position: Int) = tabLayout[position].first
}